TagDir.DLL - Set the tagfile to the current directory automatically This DLL installs an event handler which is called whenever the current buffer is switched. It tells Codewright that the tag file is located in the directory of the file currently being edited. Its purpose is free you from having to specify a tag file every time you switch projects. If you have one project per directory, just create a tags database in each project directory. Then set the tag file name ("tags.dat", for example), without a path, in CWRIGHT.INI. This handler will append that name to the directory of the file in the current buffer and use that for a tag file name. For example, when you're editing C:\PROJECTS\NIMZO\FRACUS.C, the tag file will automatically be set to C:\PROJECTS\NIMZO\TAGS.DAT. This handler requires a function to be added to startup.dll. This means editing the file tags.c in the startup directory, then rebuilding startup.dll and moving it to the codewright directory. Add these lines to tags.c, after the definition of TagSetFile(). /* * Return the name of the tag data file. */ LPSTR DLL TagQFile( void ) { if (tagFileName && *tagFileName) return(tagFileName); return(""); } Then add this line to startup.c, in the section labeled "/*** tags.c ***/" LibExport( "LPSTR TagQFile" ); To install TagDir, copy TAGDIR.DLL into the cwright directory and add these lines to the [Editor] section of CWRIGHT.INI: LibPreload=TagDir TagSetFile="tags.dat" TagSetCWD=TRUE The code in tagdir.c can be modified to change the current directory, as well. This modification may make it easier to use version control because you won't have to switch directories by hand. One potential drawback to this approach, though, is that the File Open dialog will start with the directory of the current edit file rather than that of the last file opened.